<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- saved from url=(0040)http://deepfuture.iteye.com/blog/1099223 -->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh-CN" dir="ltr"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    
    <title>Python命名规范 - 深未来(深度创造未来)[deepfuture@yeah.net] - ITeye技术网站</title>
    <meta name="description" content="  &lt;script type=&quot;text/javascript&quot;&gt;&lt;/script&gt;&lt;script type=&quot;text/javascript&quot;&gt;&lt;/script&gt;             &lt;script&gt;&lt;/script&gt;  《Python开发技术详解》 ...">
    <meta name="keywords" content="Python, 出版, JavaScript, 编程, 读书 Python命名规范">
    <link rel="shortcut icon" href="http://deepfuture.iteye.com/images/favicon.ico" type="image/x-icon">
    <link rel="search" type="application/opensearchdescription+xml" href="http://deepfuture.iteye.com/open_search.xml" title="ITeye">
    <link href="http://deepfuture.iteye.com/rss" rel="alternate" title="深未来(深度创造未来)[deepfuture@yeah.net]" type="application/rss+xml">
    <link href="./Python命名规范 - 深未来(深度创造未来)[deepfuture@yeah.net] - ITeye技术网站_files/blog.css" media="screen" rel="stylesheet" type="text/css">
<link href="./Python命名规范 - 深未来(深度创造未来)[deepfuture@yeah.net] - ITeye技术网站_files/green.css" media="screen" rel="stylesheet" type="text/css">
    <script type="text/javascript" async="" src="./Python命名规范 - 深未来(深度创造未来)[deepfuture@yeah.net] - ITeye技术网站_files/ga.js"></script><script src="./Python命名规范 - 深未来(深度创造未来)[deepfuture@yeah.net] - ITeye技术网站_files/application.js" type="text/javascript"></script>
    <script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-535605-1']);
  _gaq.push(['_setDomainName', 'iteye.com']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

</script>


      <link href="./Python命名规范 - 深未来(深度创造未来)[deepfuture@yeah.net] - ITeye技术网站_files/SyntaxHighlighter.css" media="screen" rel="stylesheet" type="text/css">
  <script src="./Python命名规范 - 深未来(深度创造未来)[deepfuture@yeah.net] - ITeye技术网站_files/shCoreCommon.js" type="text/javascript"></script>
<script src="./Python命名规范 - 深未来(深度创造未来)[deepfuture@yeah.net] - ITeye技术网站_files/hotkey.js" type="text/javascript"></script>
  <script src="./Python命名规范 - 深未来(深度创造未来)[deepfuture@yeah.net] - ITeye技术网站_files/code_favorites.js" type="text/javascript"></script>
<script src="./Python命名规范 - 深未来(深度创造未来)[deepfuture@yeah.net] - ITeye技术网站_files/weiboshare.js" type="text/javascript"></script>
  </head>
  <body style="">
    <div id="header">
      <div id="blog_site_nav">
  <a href="http://www.iteye.com/" class="homepage">首页</a>
  <a href="http://www.iteye.com/news">资讯</a>
  <a href="http://www.iteye.com/magazines">精华</a>
  <a href="http://www.iteye.com/forums">论坛</a>
  <a href="http://www.iteye.com/ask">问答</a>
  <a href="http://www.iteye.com/blogs">博客</a>
  <a href="http://www.iteye.com/blogs/subjects">专栏</a>
  <a href="http://www.iteye.com/groups">群组</a>
  <a href="http://deepfuture.iteye.com/blog/1099223#" onclick="return false;" id="msna"><u>更多</u> <small>▼</small></a>
  <div class="quick_menu" style="display:none;">
    <a target="_blank" href="http://job.iteye.com/iteye">招聘</a>
    <a href="http://www.iteye.com/search">搜索</a>
  </div>
</div>

      <div id="user_nav">
      <a href="http://deepfuture.iteye.com/login" class="welcome" title="登录">您还未登录 !</a>
    <a href="http://deepfuture.iteye.com/login">登录</a>
    <a href="http://deepfuture.iteye.com/signup" class="nobg">注册</a>
  </div>

    </div>

    <div id="page">
      <div id="branding" class="clearfix">
        <div id="blog_name">
          <h1><a href="http://deepfuture.iteye.com/">深未来(深度创造未来)[deepfuture@yeah.net]</a></h1>
        </div>
        <div id="fd"></div>
        <div id="blog_navbar">
          <ul>
            <li class="blog_navbar_for"><a href="http://deepfuture.iteye.com/"><strong>博客</strong></a></li>
            <li><a href="http://deepfuture.iteye.com/weibo">微博</a></li>
            <li><a href="http://deepfuture.iteye.com/album">相册</a></li>
            <li><a href="http://deepfuture.iteye.com/link">收藏</a></li>
            <li><a href="http://deepfuture.iteye.com/blog/guest_book">留言</a></li>
            <li><a href="http://deepfuture.iteye.com/blog/profile">关于我</a></li>
          </ul>
    
          <div class="search">
            <form action="http://deepfuture.iteye.com/blog/search" method="get">
              <input class="search_text" id="query" name="query" style="margin-left: 10px;width: 110px;" type="text" value="">
              <input class="submit_search" type="submit" value="">
            </form>
          </div> 
          <div id="fd"></div>         
        </div>
      </div>
      
      <div id="content" class="clearfix">
        <div id="main">
          



          


<div class="blog_main">
  <div class="blog_title">
    <h3>
      <a href="./Python命名规范 - 深未来(深度创造未来)[deepfuture@yeah.net] - ITeye技术网站_files/Python命名规范 - 深未来(深度创造未来)[deepfuture@yeah.net] - ITeye技术网站.html">Python命名规范</a>
      <em class="actions">      </em>
    </h3>
    <ul class="blog_categories"><strong>博客分类：</strong> <li><a href="http://deepfuture.iteye.com/category/120753">C++/C/lisp</a></li> </ul>
        <div class="news_tag"><a href="http://www.iteye.com/blogs/tag/Python">Python</a><a href="http://www.iteye.com/blogs/tag/%E5%87%BA%E7%89%88">出版</a><a href="http://www.iteye.com/blogs/tag/JavaScript">JavaScript</a><a href="http://www.iteye.com/blogs/tag/%E7%BC%96%E7%A8%8B">编程</a><a href="http://www.iteye.com/blogs/tag/%E8%AF%BB%E4%B9%A6">读书</a>&nbsp;</div>
  </div>

  <div id="blog_content" class="blog_content">
    <p>
&lt;script type="text/javascript"&gt;&lt;/script&gt;&lt;script type="text/javascript"&gt;&lt;/script&gt;
&nbsp;</p>
<div class="top-nav">
<div class="bd"></div>
</div>
<div>
&lt;script&gt;&lt;/script&gt;<div>
<h1>《Python开发技术详解》试读：2.2.1 命名规则</h1>
<div class="grid-16-8 clearfix">
<div class="article">
<div class="book-info">
<div class="book-content">
<pre class="note"><p>&nbsp;&nbsp;&nbsp; 2.2&nbsp; Python的编码规则<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; Python语言有自己独特的编码规则,包括命名规则、代码书写规则等。本节将详细介绍Python中常用的规则,并解释这些规则的原理和由来。<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; 2.2.1&nbsp; 命名规则<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; Python语言有一套自己的命名规则,用户也可以借鉴Java语言的命名规则以形成自己编码的规则。命名规则并不是规定,只是一种习惯用法。变量名的首字符必须是字母或下划线,首字符之外的字符可以由字母、数字或下划线组成,并且不能使用Python的保留字。下面介绍几种常见的规则。<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; 1.变量名、包名、模块名<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; 变量名通常由字母和下划线组成,包名、模块名通常用小写字母,如【例2-1】所示。<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; 【例2-1】演示变量名、包名、模块名的规范写法。<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; # 变量、模块名的命名规则<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; # Filename: ruleModule.py<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; _rule = "rule information"<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; 第1行代码是程序代码的注释,关于Python语言的注释请参见2.2.5节。<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; 第2行代码也是程序的注释,用于声明模块的名称,模块名用小写字母。也可以不指定模块名,以py后缀的文件就是一个模块。模块名就是文件名。<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; 第4行代码定义了一个全局变量_rule。<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; 2.类名、对象名<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; 类名首字母用大写,其他字母采用小写。对象名用小写字母。类的属性和方法名以对象作为前缀,对象通过操作符“.”访问属性和方法。类的私有变量、私有方法以两个下划线作为前缀。如【例2-2】所示。<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; 【例2-2】演示类的定义和实例化的规范写法。<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; class Student:# 类名用大写字母<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; __name = ""# 私有实例变量前必须有两个下划线<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; def __init__(self, name):<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; self.__name = name# self相当于Java中的this<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; def getName(self):# 方法名首字母用小写,其后每个单词的首字母用大写<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; return self.__name<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; if __name__ == "__main__":<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; student = Student("borphi")# 对象名用小写字母<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; printstudent.getName()<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; 第1行代码定义了一个名为Student的类,类名首字母大写。<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; 第2行代码定义了一个私有的实例变量,变量名前有两个下划线。<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; 第4行代码使用self前缀说明__name变量属于Student类。<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; 第5行代码定义了一个公有的方法,方法名首字母小写,其后的单词“Name”首字母大写。函数的命名规则与此相同。<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; 第9行代码创建了一个student对象,对象名小写。<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; 说明关于面向对象的编程知识将在第8章详细介绍,读者此时只要知道类、对象、属性以及方法的书写方式即可。<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; 3.函数名<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; 函数名通常采用小写,并用下划线或单词首字母大写来增加名称的可读性,导入的函数以模块名作为前缀。为了演示导入函数前缀的写法,下面使用了生成随机数的模块random。该模块有一个函数randrange()。该函数可以根据给定的数字范围生成随机数。randrange()的声明如下所示:<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; randrange(start, stop\[, step\])<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; 参数start表示生成随机数所在范围的开始数字。<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; 参数stop表示生成随机数所在范围的结束数字,但不包括数字stop。<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; 参数step表示从start开始往后的步数。生成的随机数在\[start,stop - 1\]的范围内,取值等于start + step。<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; 例如:<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; randrange(1, 9, 2)<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; 随机数的范围在1、3、5、7之间取得。<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; 【例2-3】演示函数的规范写法,其中定义了一个函数compareNum(),该函数用于比较两个数字的大小,并返回对应的结果。<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; # 函数中的命名规则<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; import random<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; def compareNum(num1, num2):<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; if(num1 &gt; num2):<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; return 1<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; elif(num1 == num2):<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; return 0<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; else:<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; return -1<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; num1 = random.randrange(1, 9)<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; num2 = random.randrange(1, 9)<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; print "num1 =", num1<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; print "num2 =", num2<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; print compareNum(num1, num2)<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; 第2行代码导入了random模块。<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; 第4行代码定义了一个函数compareNum(),参数num1、num2为待比较的两个变量。<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; 第5行到第10行代码比较两个数的大小,根据比较结果返回不同的结果。<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; 第11行、第12行代码调用random模块的randrange()返回两个随机数。<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; 第13行、第14行代码输出随机数,不同的机器、不同的执行时间得到的随机数均不相同。<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; 第15行代码调用compareNum(),并把产生的两个随机数作为参数传入。<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; 良好的命名习惯可以提高编程效率,使代码阅读者在不了解文档的情况下,也能理解代码的内容。<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; 下面以变量的命名为例,说明如何定义有母实际含义的名称。许多程序员对变量的命名带有随意性,如使用i、j、k等单个字母。代码阅读者并不知道这些变量的实际含义,需要阅读文档或仔细查看源代码才能了解其含义。<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; 【例2-4】演示变量命名不规范的写法。<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; # 不规范的变量命名写法<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; sum = 0<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; i = 2000<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; j = 1200<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; sum = i + 12 * j<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; 这段代码定义了一个求和变量sum,以及两个变量i、j。如果只看代码片段,并不知道该运算的含义是什么,需要通读整个函数或功能模块才能理解此处各个变量的含义。<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; 【例2-5】演示符合命名规则的写法。<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; # 规范的变量命名写法<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; sumPay = 0<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; bonusOfYear = 2000<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; monthPay = 1200<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; sumPay = bonusOfYear + 12 * monthPay<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; bonusOfYear表示年终奖金、monthPay表示月薪,因此sumPay表示全年的薪水。使变量的名字有实际含义可以节省阅读程序的时间,能更快地理解程序的含义。<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; 注意变量的命名应尽可能的表达此变量的作用,尽量避免使用缩写,以便使任何人都能理解变量名的含义。不要过多的担心变量名的长度,长的变量名往往能更表达清楚该变量的作用。<span class="remark-point"><em></em></span></p><p>&nbsp;&nbsp;&nbsp; 以上讨论的命名方式同样适用于模块名、类名、方法名、属性名等。遵守命名规则会带来很多好处。统一的命名规则便于程序开发团队合作开发同一个项目;便于统一代码的风格,理解不同程序员编写的代码;命名规范的变量名可以使程序代码更容易被理解;避免项目中随意命名变量的情况,促进程序员之间的交流。规则并不是绝对的,统一规则、表达清楚名称的含义才是制定规则的目的。<span class="remark-point"><em></em></span></p></pre>
</div>
</div>
<div class="rel-info">
<div class="rec-sec"><span class="rec"><a class=" j a_show_login a_rec_btn" name="rbtn-e-10700087" href="http://deepfuture.iteye.com/accounts/register?reason=rec-reading">推荐</a> </span></div>
</div>
<div class="paginator">
<span class="prev"><a href="http://book.douban.com/reading/10700071/"><span style="color: #336699;">2.1 Python的文件类型</span></a><span style="color: #888888;"> </span></span><span class="break"><a href="http://book.douban.com/subject/3889005/reading/"><span style="color: #336699;">回试读目录</span></a></span> <span class="next"><a href="http://book.douban.com/reading/10700099/"><span style="color: #336699;">2.2.2 代码缩进与冒号</span></a><span style="color: #888888;"> </span></span>
</div>
&lt;script id="db-templ-remarks" type="text/x-jquery-tmpl"&gt;&lt;/script&gt;&lt;script&gt;&lt;/script&gt;</div>
<div class="aside">
<p class="pl2">&gt;<a href="http://deepfuture.iteye.com/subject/3889005/"><span style="color: #336699;">Python开发技术详解</span></a></p>
<div class="indent">
<div>
<a href="http://book.douban.com/subject/3889005/"><span style="color: #336699;"><img src="./Python命名规范 - 深未来(深度创造未来)[deepfuture@yeah.net] - ITeye技术网站_files/s3914264.jpg" title="Python开发技术详解" class="fil" alt="Python开发技术详解"></span></a> <br><span class="pl"><span style="color: #666666;">作者:</span></span> 周伟, 宗杰<br><span class="pl"><span style="color: #666666;">isbn:</span></span> 7111270150<br><span class="pl"><span style="color: #666666;">书名:</span></span> Python开发技术详解<br><span class="pl"><span style="color: #666666;">页数:</span></span> 532<br><span class="pl"><span style="color: #666666;">定价:</span></span> 69.00元<br><span class="pl"><span style="color: #666666;">出版社:</span></span> 机械工业出版社<br><span class="pl"><span style="color: #666666;">装帧:</span></span> 平装<br><span class="pl"><span style="color: #666666;">出版年:</span></span> 2009<br>
</div>
</div>
</div>
</div>
</div>
<div>
<span class="fleft gray-link">© 2005－2011 douban.com, all rights reserved </span><span class="fright"><a href="http://www.douban.com/about"><span style="color: #336699;">关于豆瓣</span></a> · <a href="http://www.douban.com/about?topic=teamup"><span style="color: #336699;">在豆瓣工作</span></a> · <a href="http://www.douban.com/about?topic=contactus"><span style="color: #336699;">联系我们</span></a> · <a href="http://www.douban.com/about?policy=disclaimer"><span style="color: #336699;">免责声明</span></a> · <a href="http://book.douban.com/help/"><span style="color: #336699;">帮助中心</span></a> · <a href="http://www.douban.com/service/"><span style="color: #336699;">API</span></a> · <a href="http://book.douban.com/mobile"><span style="color: #336699;">手机读书</span></a> · <a href="http://www.douban.com/partner/"><span style="color: #336699;">品牌俱乐部</span></a> </span>
</div>
</div>
<p>
&lt;script type="text/javascript"&gt;&lt;/script&gt;&lt;script type="text/javascript"&gt;&lt;/script&gt;</p>
&lt;!-- baggins1--&gt;
  </div>

  


  
  
  <div id="bottoms" class="clearfix">
    
    <div id="share_weibo">分享到：
      <a data-type="sina" href="javascript:;" title="分享到新浪微博"><img src="./Python命名规范 - 深未来(深度创造未来)[deepfuture@yeah.net] - ITeye技术网站_files/sina.jpg"></a>
      <a data-type="qq" href="javascript:;" title="分享到腾讯微博"><img src="./Python命名规范 - 深未来(深度创造未来)[deepfuture@yeah.net] - ITeye技术网站_files/tec.jpg"></a>
    </div>
  </div>

  <div class="blog_nav">
    <div class="pre_next">
      <a href="http://deepfuture.iteye.com/blog/1112655" class="next" title="数学合集">数学合集</a>
      |
      <a href="http://deepfuture.iteye.com/blog/1098333" class="pre" title="u盘文件被隐藏的处理">u盘文件被隐藏的处理</a>
    </div>
  </div>
  <div class="blog_bottom">
    <ul>
      <li>2011-06-21 10:03</li>
      <li>浏览 795</li>
      <li><a href="http://deepfuture.iteye.com/blog/1099223#comments">评论(0)</a></li>
      
      
      <li>分类:<a href="http://www.iteye.com/blogs/category/language">编程语言</a></li>      
      <li class="last"><a href="http://www.iteye.com/wiki/blog/1099223" target="_blank" class="more">相关推荐</a></li>
    </ul>
  </div>

  <div class="blog_comment">
    <h5>评论</h5>
    <a id="comments" name="comments"></a>
    
    
    
  </div>

  <div class="blog_comment">
    <h5>发表评论</h5>
            <p style="text-align:center; margin-top:30px;margin-bottom:0px;"><a href="http://deepfuture.iteye.com/login" style="background-color:white;"> <img src="./Python命名规范 - 深未来(深度创造未来)[deepfuture@yeah.net] - ITeye技术网站_files/login_icon.png" style="vertical-align:middle; margin-right: 10px;"></a><a href="http://deepfuture.iteye.com/login">  您还没有登录,请您登录后再发表评论 </a></p>
      </div>
</div>


<script type="text/javascript">
  dp.SyntaxHighlighter.HighlightAll('code', true, true);

  $$('#main .blog_content pre[name=code]').each(function(pre, index){ // blog content
    var post_id = 1099223;
    var location = window.location;
    source_url = location.protocol + "//" + location.host + location.pathname + location.search;
    pre.writeAttribute('codeable_id', post_id);
    pre.writeAttribute('codeable_type', "Blog");
    pre.writeAttribute('source_url', source_url);
    pre.writeAttribute('pre_index', index);
    pre.writeAttribute('title', 'Python命名规范');
  });

  fix_image_size($$('div.blog_content img'), 700);

  function processComment() {
    $$('#main .blog_comment > div').each(function(comment){// comment
      var post_id = comment.id.substr(2);
      $$("#"+comment.id+" pre[name=code]").each(function(pre, index){
        var location = window.location;
        source_url = location.protocol + "//" + location.host + location.pathname + location.search;
        source_url += "#" + comment.id;
        pre.writeAttribute('codeable_id', post_id);
        pre.writeAttribute('codeable_type', "BlogComment");
        pre.writeAttribute('source_url', source_url);
        pre.writeAttribute('pre_index', index);
        pre.writeAttribute('title', 'Python命名规范');
      });
    });
  }

  function quote_comment(id) {
    new Ajax.Request('/editor/quote', {
      parameters: {'id':id, 'type':'BlogComment'},
      onSuccess:function(response){editor.bbcode_editor.textarea.insertAfterSelection(response.responseText);
        Element.scrollTo(editor.bbcode_editor.textarea.element);}
    });
  }

  code_favorites_init();
  processComment();
  new WeiboShare({share_buttons: $('share_weibo'), img_scope: $('blog_content')});
</script>




        </div>

        <div id="local">
          <div class="local_top"></div>
          <div id="blog_owner">
  <div id="blog_owner_logo"><a href="http://deepfuture.iteye.com/"><img alt="deepfuture的博客" class="logo" src="./Python命名规范 - 深未来(深度创造未来)[deepfuture@yeah.net] - ITeye技术网站_files/d08c7f3a-9298-3a06-9235-0d0226833f0a.jpg" title="deepfuture的博客: 深未来(深度创造未来)[deepfuture@yeah.net]"></a></div>
  <div id="blog_owner_name">deepfuture</div>
</div>

          <div id="blog_actions">
            <ul>
              <li>浏览: 887335 次</li>
              <li>性别: <img alt="Icon_minigender_1" src="./Python命名规范 - 深未来(深度创造未来)[deepfuture@yeah.net] - ITeye技术网站_files/icon_minigender_1.gif" title="男"></li>
              <li>来自: 湛江</li>
              <li><img src="./Python命名规范 - 深未来(深度创造未来)[deepfuture@yeah.net] - ITeye技术网站_files/offline.gif"></li>
              
            </ul>
          </div>
          <div id="user_visits" class="clearfix">
            <h5>最近访客 <span style="font-weight:normal;font-size:12px;padding-left:30px;"><a href="http://deepfuture.iteye.com/blog/user_visits">更多访客&gt;&gt;</a></span></h5>
            
              <div class="user_visit">
                <div class="logo"><a href="http://dylinshi126.iteye.com/" target="_blank"><img alt="dylinshi126的博客" class="logo" src="./Python命名规范 - 深未来(深度创造未来)[deepfuture@yeah.net] - ITeye技术网站_files/user-logo-thumb.gif" title="dylinshi126的博客: "></a></div>
                <div class="left"><a href="http://dylinshi126.iteye.com/" target="_blank" title="dylinshi126">dylinshi126</a></div>
              </div>
            
              <div class="user_visit">
                <div class="logo"><a href="http://luoshan.iteye.com/" target="_blank"><img alt="luoshan的博客" class="logo" src="./Python命名规范 - 深未来(深度创造未来)[deepfuture@yeah.net] - ITeye技术网站_files/user-logo-thumb.gif" title="luoshan的博客: "></a></div>
                <div class="left"><a href="http://luoshan.iteye.com/" target="_blank" title="luoshan">luoshan</a></div>
              </div>
            
              <div class="user_visit">
                <div class="logo"><a href="http://dreamone.iteye.com/" target="_blank"><img alt="DreamOne的博客" class="logo" src="./Python命名规范 - 深未来(深度创造未来)[deepfuture@yeah.net] - ITeye技术网站_files/user-logo-thumb.gif" title="DreamOne的博客: DreamOne"></a></div>
                <div class="left"><a href="http://dreamone.iteye.com/" target="_blank" title="DreamOne">DreamOne</a></div>
              </div>
            
              <div class="user_visit">
                <div class="logo"><a href="http://maohualei.iteye.com/" target="_blank"><img alt="maohualei的博客" class="logo" src="./Python命名规范 - 深未来(深度创造未来)[deepfuture@yeah.net] - ITeye技术网站_files/8f1eeebc-08ad-3a28-b57b-a8534dedeb5f-thumb.jpg" title="maohualei的博客: 一个旅人"></a></div>
                <div class="left"><a href="http://maohualei.iteye.com/" target="_blank" title="maohualei">maohualei</a></div>
              </div>
            
          </div>

          
            <div>
              <h5>博客专栏</h5>
              

  
  <dl class="series" style="padding-bottom:5px;">
    <dt>
      <a href="http://www.iteye.com/blogs/subjects/deepfuture" target="_blank"><img alt="073ec2a9-85b7-3ebf-a3bb-c6361e6c6f64" src="./Python命名规范 - 深未来(深度创造未来)[deepfuture@yeah.net] - ITeye技术网站_files/073ec2a9-85b7-3ebf-a3bb-c6361e6c6f64.png"></a>
    </dt>
    <dd>
    <a href="http://www.iteye.com/blogs/subjects/deepfuture" target="_blank" title="SQLite源码剖析">SQLite源码剖析</a><br>
      <span class="visited">浏览量：19598</span>
    </dd>
  </dl>
  
  <dl class="series" style="padding-bottom:5px;">
    <dt>
      <a href="http://www.iteye.com/blogs/subjects/D_WIN32" target="_blank"><img alt="1591c4b8-62f1-3d3e-9551-25c77465da96" src="./Python命名规范 - 深未来(深度创造未来)[deepfuture@yeah.net] - ITeye技术网站_files/1591c4b8-62f1-3d3e-9551-25c77465da96.jpg"></a>
    </dt>
    <dd>
    <a href="http://www.iteye.com/blogs/subjects/D_WIN32" target="_blank" title="WIN32汇编语言学习应用">WIN32汇编语言学习应用...</a><br>
      <span class="visited">浏览量：18058</span>
    </dd>
  </dl>
  
  <dl class="series" style="padding-bottom:5px;">
    <dt>
      <a href="http://www.iteye.com/blogs/subjects/perl" target="_blank"><img alt="F5390db6-59dd-338f-ba18-4e93943ff06a" src="./Python命名规范 - 深未来(深度创造未来)[deepfuture@yeah.net] - ITeye技术网站_files/f5390db6-59dd-338f-ba18-4e93943ff06a.jpg"></a>
    </dt>
    <dd>
    <a href="http://www.iteye.com/blogs/subjects/perl" target="_blank" title="神奇的perl">神奇的perl</a><br>
      <span class="visited">浏览量：25253</span>
    </dd>
  </dl>
  
  <dl class="series" style="padding-bottom:5px;">
    <dt>
      <a href="http://www.iteye.com/blogs/subjects/lucene" target="_blank"><img alt="Dac44363-8a80-3836-99aa-f7b7780fa6e2" src="./Python命名规范 - 深未来(深度创造未来)[deepfuture@yeah.net] - ITeye技术网站_files/dac44363-8a80-3836-99aa-f7b7780fa6e2.jpg"></a>
    </dt>
    <dd>
    <a href="http://www.iteye.com/blogs/subjects/lucene" target="_blank" title="lucene等搜索引擎解析">lucene等搜索引擎解析...</a><br>
      <span class="visited">浏览量：73670</span>
    </dd>
  </dl>
  
  <dl class="series" style="padding-bottom:5px;">
    <dt>
      <a href="http://www.iteye.com/blogs/subjects/lucene_source" target="_blank"><img alt="Ec49a563-4109-3c69-9c83-8f6d068ba113" src="./Python命名规范 - 深未来(深度创造未来)[deepfuture@yeah.net] - ITeye技术网站_files/ec49a563-4109-3c69-9c83-8f6d068ba113.jpg"></a>
    </dt>
    <dd>
    <a href="http://www.iteye.com/blogs/subjects/lucene_source" target="_blank" title="深入lucene3.5源码">深入lucene3.5源码...</a><br>
      <span class="visited">浏览量：2484</span>
    </dd>
  </dl>
  
  <dl class="series" style="padding-bottom:5px;">
    <dt>
      <a href="http://www.iteye.com/blogs/subjects/VB_NET" target="_blank"><img alt="9b99bfc2-19c2-3346-9100-7f8879c731ce" src="./Python命名规范 - 深未来(深度创造未来)[deepfuture@yeah.net] - ITeye技术网站_files/9b99bfc2-19c2-3346-9100-7f8879c731ce.jpg"></a>
    </dt>
    <dd>
    <a href="http://www.iteye.com/blogs/subjects/VB_NET" target="_blank" title="VB.NET并行与分布式编程">VB.NET并行与分布式编...</a><br>
      <span class="visited">浏览量：9202</span>
    </dd>
  </dl>
  
  <dl class="series" style="padding-bottom:5px;">
    <dt>
      <a href="http://www.iteye.com/blogs/subjects/silverlight" target="_blank"><img alt="B1db2af3-06b3-35bb-ac08-59ff2d1324b4" src="./Python命名规范 - 深未来(深度创造未来)[deepfuture@yeah.net] - ITeye技术网站_files/b1db2af3-06b3-35bb-ac08-59ff2d1324b4.jpg"></a>
    </dt>
    <dd>
    <a href="http://www.iteye.com/blogs/subjects/silverlight" target="_blank" title="silverlight 5开发【vb版】">silverlight 5...</a><br>
      <span class="visited">浏览量：5575</span>
    </dd>
  </dl>
  
  <dl class="series" style="padding-bottom:5px;">
    <dt>
      <a href="http://www.iteye.com/blogs/subjects/sfxwc" target="_blank"><img alt="4a56b548-ab3d-35af-a984-e0781d142c23" src="./Python命名规范 - 深未来(深度创造未来)[deepfuture@yeah.net] - ITeye技术网站_files/4a56b548-ab3d-35af-a984-e0781d142c23.gif"></a>
    </dt>
    <dd>
    <a href="http://www.iteye.com/blogs/subjects/sfxwc" target="_blank" title="算法下午茶系列">算法下午茶系列</a><br>
      <span class="visited">浏览量：4841</span>
    </dd>
  </dl>
  


            </div>
          

                      <div id="blog_menu">
              <h5>文章分类</h5>
              <ul>
                <li><a href="http://deepfuture.iteye.com/">全部博客 (1581)</a></li>
                
                  <li><a href="http://deepfuture.iteye.com/category/120753">C++/C/lisp (274)</a></li>
                
                  <li><a href="http://deepfuture.iteye.com/category/93493">数学与计算 (435)</a></li>
                
                  <li><a href="http://deepfuture.iteye.com/category/93496">搜索引擎 (148)</a></li>
                
                  <li><a href="http://deepfuture.iteye.com/category/93499">系统管理/系统架构/项目管理 (158)</a></li>
                
                  <li><a href="http://deepfuture.iteye.com/category/94104">WIN32系统开发 (85)</a></li>
                
                  <li><a href="http://deepfuture.iteye.com/category/93633">解释语言 (150)</a></li>
                
                  <li><a href="http://deepfuture.iteye.com/category/96327">脚本语言 (203)</a></li>
                
                  <li><a href="http://deepfuture.iteye.com/category/154157">数据库 (41)</a></li>
                
                  <li><a href="http://deepfuture.iteye.com/category/212449">深入lucene 3.5源码 (9)</a></li>
                
                  <li><a href="http://deepfuture.iteye.com/category/215643">access vba开发 (14)</a></li>
                
                  <li><a href="http://deepfuture.iteye.com/category/216266">.net&amp;silverlight (58)</a></li>
                
              </ul>
            </div>
            <div id="month_blogs">
              <h5>社区版块</h5>
              <ul>
                <li><a href="http://deepfuture.iteye.com/blog/news">我的资讯</a> (0)</li>
                <li>
                  <a href="http://deepfuture.iteye.com/blog/post">我的论坛</a> (47)
                </li>
                <li><a href="http://deepfuture.iteye.com/blog/answered_problems">我的问答</a> (104)</li>
              </ul>
            </div>
            <div id="month_blogs">
              <h5>存档分类</h5>
              <ul>
                
                  <li><a href="http://deepfuture.iteye.com/blog/monthblog/2013-06">2013-06</a> (3)</li>
                
                  <li><a href="http://deepfuture.iteye.com/blog/monthblog/2013-05">2013-05</a> (2)</li>
                
                  <li><a href="http://deepfuture.iteye.com/blog/monthblog/2013-04">2013-04</a> (6)</li>
                
                <li><a href="http://deepfuture.iteye.com/blog/monthblog_more">更多存档...</a></li>
              </ul>
            </div>
            
            
              <div id="comments_top">
                <h5>评论排行榜</h5>
                <ul>
                  
                    <li><a href="http://deepfuture.iteye.com/blog/1613808" title="matlab-神经网络-线性网络(2)">matlab-神经网络-线性网络(2)</a></li>
                  
                    <li><a href="http://deepfuture.iteye.com/blog/1662571" title="算法下午茶系列-美好的下午茶时光">算法下午茶系列-美好的下午茶时光</a></li>
                  
                    <li><a href="http://deepfuture.iteye.com/blog/1632378" title="建立 Gtalk 群聊的多种方法">建立 Gtalk 群聊的多种方法</a></li>
                  
                    <li><a href="http://deepfuture.iteye.com/blog/1611249" title="matlab-神经网络-感知机(6)">matlab-神经网络-感知机(6)</a></li>
                  
                </ul>
              </div>
            

            <div id="guest_books">
              <h5>最新评论</h5>
              <ul>
                
                <li>
                  <a href="http://jiaqian0118.iteye.com/" target="_blank" title="jiaqian0118">jiaqian0118</a>： 
                  解压密码在哪，怎么没找到。谢谢了<br>
                  <a href="http://deepfuture.iteye.com/blog/605210#bc2313869">搜索引擎开发lucene-笔者博客的大部分lucene习作源码</a>
                </li>
                
                <li>
                  <a href="http://deepfuture.iteye.com/" target="_blank" title="deepfuture">deepfuture</a>： 
                  内存索引写入硬盘文件索引的结果放到硬盘中，这样重启电脑后，仍然 ...<br>
                  <a href="http://deepfuture.iteye.com/blog/575110#bc2309726">lucene-内存索引、内存索引保存在硬盘、索引优化</a>
                </li>
                
                <li>
                  <a href="http://w156445045.iteye.com/" target="_blank" title="w156445045">w156445045</a>： 
                  博主，您好，请问下内存索引的原理是什么呢，大致是什么意思呢？文 ...<br>
                  <a href="http://deepfuture.iteye.com/blog/575110#bc2309679">lucene-内存索引、内存索引保存在硬盘、索引优化</a>
                </li>
                
                <li>
                  <a href="http://henchong.iteye.com/" target="_blank" title="henchong">henchong</a>： 
                  用office excel 2007 打开是空白的，没有数据解 ...<br>
                  <a href="http://deepfuture.iteye.com/blog/1471909#bc2308847">Flex导出Excel </a>
                </li>
                
                <li>
                  <a href="http://henchong.iteye.com/" target="_blank" title="henchong">henchong</a>： 
                  用office excel 2007 打开是空白的，没有数据
 ...<br>
                  <a href="http://deepfuture.iteye.com/blog/1471909#bc2308846">Flex导出Excel </a>
                </li>
                
              </ul>
            </div>

            <div class="local_bottom"></div>
          
        </div>
      </div>

      <div id="footer" class="clearfix">
        <div id="copyright">
          <hr>
          声明：ITeye文章版权属于作者，受法律保护。没有作者书面许可不得转载。若作者同意转载，必须以超链接形式标明文章原始出处和作者。<br>
          © 2003-2012 ITeye.com.   All rights reserved.  [ 京ICP证110151号  京公网安备110105010620 ]
        </div>
      </div>
    </div>
    <script type="text/javascript">
  document.write("<img src='http://stat.iteye.com/?url="+ encodeURIComponent(document.location.href) + "&referrer=" + encodeURIComponent(document.referrer) + "&user_id=' width='0' height='0' />");
</script><img src="./Python命名规范 - 深未来(深度创造未来)[deepfuture@yeah.net] - ITeye技术网站_files/saved_resource" width="0" height="0">

    
<script type="text/javascript" src="./Python命名规范 - 深未来(深度创造未来)[deepfuture@yeah.net] - ITeye技术网站_files/tongji.js"></script><img src="./Python命名规范 - 深未来(深度创造未来)[deepfuture@yeah.net] - ITeye技术网站_files/tongji.do" border="0" width="1" height="1"><a href="http://tongji.linezing.com/report.html?unit_id=1450409" target="_blank">量子统计</a>
      
    
  

</body></html>